<?php
// File Security Check
if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
    die ( 'You do not have sufficient permissions to access this page!' );
}
?>
<?php
/**
 * Header Template
 *
 * Here we setup all logic and XHTML that is required for the header section of all screens.
 *
 * @package WooFramework
 * @subpackage Template
 */
global $woo_options, $woocommerce;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="<?php if ( $woo_options['woo_boxed_layout'] == 'true' ) echo 'boxed'; ?> <?php if (!class_exists('woocommerce')) echo 'woocommerce-deactivated'; ?>">
<head>

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php woo_title(''); ?></title>
<?php woo_meta(); ?>
<link rel="stylesheet" type="text/css" href="<?php bloginfo( 'stylesheet_url' ); ?>" media="screen" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
	wp_head();
	woo_head();
?>

	<link href="<?php echo get_stylesheet_directory_uri(); ?>/css/normalize.css" rel="stylesheet" media="screen">
    <!-- Bootstrap -->
    <link href="<?php echo get_stylesheet_directory_uri(); ?>/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="<?php echo get_stylesheet_directory_uri(); ?>/css/customize.css" rel="stylesheet"  media="screen">
    <link href="<?php echo get_stylesheet_directory_uri(); ?>/font/ThaiSanNeue/stylesheet.css" rel="stylesheet" media="screen">
   	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/jquery.easing.1.3.js"></script>
	<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/jquery.anyslider.js"></script>
     
    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/css/jquery-anyslider.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    	<link href="<?php echo get_stylesheet_directory_uri(); ?>/css/fontello-ie7.css" rel="stylesheet" media="screen">
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body  <?php body_class(); ?>>
  <?php woo_top(); ?>
    <div class="container">
    	<header>
            <div class="topbar row topbar--modifier">
            
            <?php if (!is_user_logged_in()) { // "Hello there, Guest..." plus the form ?>
        	
            <div class="topbar__login col-xs-12 col-sm-6 col-md-6 col-lg-6 text-left">ยินดีต้อนรับ ผู้เยี่ยมชม, <a href="<?php echo wp_login_url( get_permalink()); ?>" title="Login">เข้าสู่ระบบ</a> หรือ <a href="<?php echo wp_registration_url(); ?>" title="Register">สมัครสมาชิก</a></div><!--End of topbar__login-->
            
        <?php } else { // Welcome back, username. Logout. ?>
            
            <?php $current_user = wp_get_current_user(); ?>
    
            <div class="topbar__login col-xs-12 col-sm-6 col-md-6 col-lg-6 text-left">ยินดีต้อนรับ <?php echo $current_user->user_login ?> , <a href="<?php echo wp_logout_url( get_permalink()); ?>" title="Login">ออกจากระบบ</a> หรือ <a href="http://localhost/sahatawee/my-account/" title="Account">ข้อมูลส่วนตัว</a></div><!--End of topbar__login-->
            
        <?php } ?>
                         
                <ul class="topbar__shop col-sm-6 col-md-6 col-lg-6 visible-lg visible-md visible-sm text-right">
				<?php woocommerce_cart_link(); ?>
               <li> | </li>
			   <li><?php $checkout_url = $woocommerce->cart->get_checkout_url(); ?> <span class="glyphicon glyphicon-check"></span><a href="<?php echo $checkout_url; ?>" >ชำระเงิน</a></li></ul> <!--End of topbar__shop-->
            </div><!--End of topbar-->
        
            <div class="beforeNav row beforeNav--modifier">
                <div class="beforeNav__logo col-xs-12 col-sm-3 col-md-3">
                	<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="logo"/>
                </div><!--End of beforeNav__logo-->
                <div class="beforeNav__tel col-sm-9 col-md-9 visible-sm visible-md visible-lg text-right">
                	<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/tel_header.png" alt="กรุณาติดต่อ 024087690-9"/>
                </div><!--End of beforeNav__tel-->
            </div><!--End of beforeNav-->
            
            
            
            <nav class="row nav--modifier">
            
            <?php
			if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
				wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav__list col-lg-12', 'theme_location' => 'primary-menu' ) );
			} else {
			?>
	        <ul id="main-nav" class="nav fl nav__list col-lg-12">
				<?php if ( is_page() ) $highlight = 'page_item'; else $highlight = 'page_item current_page_item'; ?>
				<li class="<?php echo $highlight; ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
				<?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
			</ul><!-- /#nav -->
	        <?php } ?>
            	<!--<ul class="nav__list col-lg-12">
                <li><a href="<?php echo get_stylesheet_directory_uri(); ?>/index.html">หน้าหลัก</a></li>
                <li><a href="#">บริการของเรา</a></li>
                <li><a href="<?php echo get_stylesheet_directory_uri(); ?>/projects.html">ผลงานของเรา</a></li>
                <li><a href="#">สินค้าของเรา</a></li>
                <li><a href="<?php echo get_stylesheet_directory_uri(); ?>/contact.html">ติดต่อเรา</a></li>
                </ul><!--End of Navigation-->
            </nav><!--End of nav-->
        </header><!-- End header tag-->